package pci;

/*
 * 测试类
 */

public class Test {
	public static void main(String[] args) {
		// 方法一：
		System.out.println("方法一：");
		
		PCI gc = new GraphicsCard();
		PCI sc = new SoundCard();
		PCI nc = new NetworkCard();
		
		Assemble assemble;
		
		// 显卡
		assemble = new Assemble(gc);
		assemble.work();
		
		// 声卡
		assemble = new Assemble(sc);
		assemble.work();
		
		// 网卡
		assemble = new Assemble(nc);
		assemble.work();
		
		
		//方法二：
		System.out.println("方法二：");
		
		PCI pci;

		// 显卡
		pci = new GraphicsCard();
		pci.start();
		pci.stop();

		// 声卡
		pci = new SoundCard();
		pci.start();
		pci.stop();

		// 网卡
		pci = new NetworkCard();
		pci.start();
		pci.stop();
	}
}
